package com.haopt.netty.client;

import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.socket.SocketChannel;

/**
 * @description: 客户端初始化操作
 * @author chenqb
 * @date 2023/10/7 17:02
 * @version 1.0
 */
public class NewClientChannelInitializer extends ChannelInitializer<SocketChannel> {

    protected void initChannel(SocketChannel socketChannel) throws Exception {
        ChannelPipeline pipeline = socketChannel.pipeline();
        //自定义pipeline
        pipeline.addLast(new NewEncoder());
        pipeline.addLast(new NewClientHandler());
    }
}